<?php
$oUsers = UserHandler::getUsers();
$sClientUsers = ClientHandler::getUsers($_REQUEST['iClientgroup']);
$oClientgroups = ClientHandler::getClientgroups();
?>
<div id="layer_client_users" class="hidden" style="visibility: visible;">
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="3"><?php print msg('Clientlist assignment') ?></td>
	</tr>
	<tr>
		<td class="boxbody" colspan="3">
			<?php print msg('Clientlist') ?>: <?php print $oClientgroups[$_REQUEST['iClientgroup']]->sName ?>
		</td>
	</tr>
	<tr>
		<td class="listtop center"><a href="javascript: showBox('client-useradd', 'iClientgroup=<?php print $_REQUEST['iClientgroup'] ?>');"><img src="images/<?php print $_SESSION['oUserVars']['images'] ?>/user-add.png" border="0"></a></td>
		<td class="listtop"><?php print msg('User') ?></td>
		<td class="listtop center"><?php print msg('Rights') ?></td>
	</tr>
<?php
foreach ($sClientUsers as $iUser => $sAccess)
{
	?>
	<tr>
		<td class="listentity center">
	<?php
	if ($iUser != $_SESSION['rid']) {
		print '<a href="javascript: showBox(\'client-userdelete\', \'iClientgroup='.$_REQUEST['iClientgroup'].'&iUser='.$iUser.'\');"><img src="images/'.$_SESSION['oUserVars']['images'].'/user-delete.png" border="0"></a> ';
		print '<a href="javascript: showBox(\'client-userchange\', \'iClientgroup='.$_REQUEST['iClientgroup'].'&iUser='.$iUser.'\');"><img src="images/'.$_SESSION['oUserVars']['images'].'/user-change.png" border="0"></a> ';
	}
	else {
		print '&nbsp;';
	}
	?>
		</td>
		<td class="listentity"><?php print $oUsers[$iUser]->sUser ?></td>
		<td class="listentity center"><?php print ($sAccess == 'admin' ? msg('Admin') : msg('User')) ?></td>
	</tr>
	<?php
}
?>
	<tr>
		<td class="boxbody center" colspan="3">
			<input type="button" value="<?php print msg('Cancel') ?>" onClick="layerHide('layer_client_users');">
		</td>
	</tr>
</table>
</div>
